package com.zzyl.nursing.controller.Member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.common.utils.UserThreadLocal;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;


@RestController
@RequestMapping("/member/orders/project")
@Api(tags = "护理项目列表")
public class MemberProjectController extends BaseController {

    @Autowired
    private INursingProjectService iNursingProjectService;

    @GetMapping("/page")
    @ApiOperation("根据状态查询护理项目")
    public TableDataInfo<NursingProject> list(Integer status,Integer pageSize,Integer pageNum,String name) {
        return  iNursingProjectService.pageByNameAndStatus(status, pageSize, pageNum, name);
    }

    @GetMapping("/{id}")
    @ApiOperation("获取护理项目详细信息")
    public AjaxResult getInfo(@PathVariable("id")Long id){
        return success(iNursingProjectService.selectNursingProjectById(id));
    }
}
